<?php

class MaterialsUsedView extends Doctrine_Table
{
    public static function getInstance()
    {
        return Doctrine_Core::getTable('MaterialsUsed');
    }

    public static function findbyOrderQuery($order) {      
        
        $query = self::getInstance()
                        ->createQuery('c')
                        ->where('order_id = ?', array($order->getId()));

        return $query;
    }
    
        public static function findbyOrder($order) {

        $query = self::getInstance()
                        ->createQuery('c')
                        ->where('order_id = ?', array($order->getId()));

        return $query->execute();
    }
}